import { create } from 'zustand'

interface AuthState {
  isAuthenticated: boolean
  currentUser: string
  login: (username: string) => void
  logout: () => void
}

export const useAuthStore = create<AuthState>((set) => ({
  isAuthenticated: false,
  currentUser: '',
  login: (username: string) => set({ isAuthenticated: true, currentUser: username }),
  logout: () => set({ isAuthenticated: false, currentUser: '' }),
}))
